{include file="public/header"/}


<div id="container">
    
        <div id="page-header" class="am-cf">

        <div class="button">
            <a onclick="show()" class="am-btn am-btn-xs am-btn-primary" data-pjax><i class="am-icon-plus"></i> 添加常见问题</a>
        </div>
    </div>

     <section class="panel" style="width: 98%;margin: 5px auto;">
        <table class="table">

            <tr>
                <th>问题</th>
                <th>回答</th>
                <th>操作</th>
            </tr>
            {volist name='lister' id='talk'}

                <tr>
	                <td>{$talk.question}</td>
	                <td style="display: inline-block;width:100%;max-height: 90px;overflow-y: auto;">{$talk.answer}</td>
	                <td>
	                    <a onclick='show({$talk.qid})' class='am-badge am-badge-primary'><i class='am-icon-edit'></i> 编辑</a><a onclick="getdelete({$talk.qid})" class='am-badge am-badge-danger'> <i class='am-icon-recycle'></i> 删除</a>
	                </td>
               </tr>
            {/volist}
        
            
        </table>
       {$page}
    </section>

<div id='bianji' style="margin-top:10px;display:none;">

</div>
 
  
</div>

<script>
	

function show(id){


		 layer.open({
            type: 2,
            title: '编辑',
            area: ['800px', '560px'],
            shade: false,
            content: '/admin/index/editer?qid='+id
        });
	}
  

function getdelete(id){

    $.ajax({
        url:'/admin/set/getdeleteQuestion',
        type:'post',
        data:{qid:id},
        success:function(res){
            if(res.code == 0){
                layer.msg(res.msg,{icon:1,end:function(){
                    location.reload();
                }})
            }
        }
    })

}
    


</script>


{include file="public/footer"/}
